package com.three.controller;

import com.three.entity.OutlibraryGoods;
import com.three.service.OutlibraryGoodsService;
import com.three.vo.R;
import com.three.vo.TimeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.sql.Array;
import java.util.ArrayList;

/**
 * @author 袁大毛
 * * @date 2024/10/29 上午9:13
 * @描述 统计图控制层
 */
@RestController
@RequestMapping("/statistics")
public class StatisticsController {
    @Autowired
    private OutlibraryGoodsService outlibraryGoodsService;

    //根据当前门店查询出来，当前门店亏损多少，盈利多少  第一个图
    @GetMapping("/getByBranchIdYingLi")
    public R getByBranchIdYingLi(){
        return outlibraryGoodsService.getByBranchIdYingLi();
    }
    // 获取   每个门店的营业额   第二个图
    @GetMapping("/getByBranchYingLiE")
    public R getByBranchYingLiE(){
        return outlibraryGoodsService.getByBranchYingLiE();
    }
    // 获取   该门店下商品销量统计   第三个图
    @GetMapping("/getStatisticsInfo")
    public R getOutlibraryGoods(){
        //System.out.println("!!!!!!!!!");
        return outlibraryGoodsService.getOutlibraryGoods();
    }

    @PostMapping("/loadtu01")
    //本店营销额和成本
    public R loadtu01(@RequestBody TimeVo timeVo){
        return outlibraryGoodsService.loadtu01(timeVo);
    }
    @PostMapping("/loadtu02")
    //各分店营销额统计
    public R loadtu02(@RequestBody TimeVo timeVo){
        return outlibraryGoodsService.loadtu02(timeVo);
    }
    @PostMapping("/loadtu03")
    //各商品销量统计
    public R loadtu03(@RequestBody TimeVo timeVo){
        return outlibraryGoodsService.loadtu03(timeVo);
    }

    @GetMapping("/loadBranchName")
    //获取当前门店名称
    public R loadBranchName(){
        return outlibraryGoodsService.loadBranchName();
    }
}